package top.buluoluo.productservice.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;

/**
 * 商品SKU表(ProductSku)表实体类
 *
 * @author makejava
 * @since 2025-10-07 16:19:01
 */
@Data
@TableName(value = "product_sku", autoResultMap = true)
public class ProductSku {
    //SKU ID
    @TableId(type = IdType.AUTO)
    private Long id;
    //SKU编码，唯一
    private String skuCode;
    //商户ID
    private Long merchantId;
    //所属SPU ID
    private Long spuId;
    //规格属性（JSON键值对），如{"颜色":"白色","内存":"128GB"}
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, String> specs;
    //销售价
    private BigDecimal price;
    //原价
    private BigDecimal originalPrice;
    //库存数量
    private Long stockQuantity;
    //锁定库存（如已下单未支付）
    private Long lockStock;
    //SKU特有图片
    private String imageUrl;
    //状态：0-禁用，1-启用
    private Integer status;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    private String specsHash;

}

